package day1901;

public class duoxiancheng {
    public static void main(String[] args) {
        dxc a = new dxc();
        dxc b = new dxc();
        dxc c = new dxc();
        dxc d = new dxc();

        a.start();
        b.start();
        c.start();
        d.start();
    }
}

class dxc extends Thread{
    static int a =100;
    @Override
    public void run() {
        while (true){
            synchronized (dxc.class){
                if(a>0){
                    try {
                        Thread.sleep(10);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    System.out.println(Thread.currentThread().getName()+" "+a--);
                }
                else
                    return;
            }

        }
    }
}
